package NO09;

/**
 * 跳台阶
 * @author swg
 *
 */
public class JumpFloor {
	public static int jumpFloor(int target){
		int a = 1,b = 2,c = 0;
		if(target <= 0){
			return 0;
		}else if(target == 1){
			return 1;
		}else if(target ==2){
			return 2;
		}else{
			for(int i=3;i<=target;i++){
				c = a+b;
				a = b;
				b = c;
			}
			return c;
		}
	}
	
	public static void main(String[] args) {
		System.out.println(jumpFloor(4));
	}
}
